Skip to content

feat(sidebar): use PR-state icon as the workspace icon#41

Merged
Zeus-Deus merged 2 commits into
mainfrom
workspace-icon-pr-status
May 26, 2026
Merged

feat(sidebar): use PR-state icon as the workspace icon#41
Zeus-Deus merged 2 commits into
mainfrom
workspace-icon-pr-status

Conversation

@Zeus-Deus
Copy link
Copy Markdown
Owner

Summary

  • The leading icon on a worktree workspace row now reflects PR state when a PR exists — open (green pull-request), merged (purple git-merge), closed (red closed-PR), draft (gray draft-PR). The icon is a button: click opens the PR URL on GitHub; hovering it shows a tooltip with the PR number (Open PR #39 — click to open).
  • The previous trailing PR pill (colored icon + duplicated #39) is removed entirely — the leading icon + tooltip already carry the same signal, so the right-side number was redundant noise.
  • Primary, remote, and OpenFlow workspaces keep their existing icons (laptop / cloud / workflow). Non-PR worktrees fall back to the plain branch icon. Push/pull in-flight still shows the spinner.

The agent-state status dots (working amber/pulsing, review green, permission red/pulsing) are structurally unchanged. StatusIndicator is rendered as an absolute-positioned sibling of the icon in the row's icon column, so the dots still overlay the top-right corner regardless of whether the leading glyph is the branch icon or the new PR-state icon. An inline comment locks in that invariant.

Test plan

  • npm run check — TypeScript clean
  • npm run test — 1718/1718 passing, including 6 new tests in sidebar-workspace.test.tsx:
    • GitPullRequest renders (not GitBranch) for pr_state: "OPEN"
    • GitMerge renders for "MERGED"
    • GitPullRequestClosed renders for "CLOSED"
    • Clicking the icon button opens the PR URL via openUrl and does NOT activate the workspace (stopPropagation works)
    • The trailing #39 is gone, and there's exactly one PR button on the row
    • GitBranch fallback still renders when no PR
  • Visual smoke test — rendered the four PR states + three status-dot overlays via a one-shot preview page; confirmed the icon swap and the dots co-existing.

Follow-up

Notes

  • Pure visual change. No Rust, no IPC, no data fetching, no WorkspaceSnapshot type changes. Same pr_state / pr_number / pr_url fields, same refresh_workspace_pr flow, same openUrl click behavior — just bound to the leading icon instead of the trailing pill.
  • package-lock.json is included because npm install reconciled it with the 0.6.1 version bump from a56074d.

Zeus-Deus added 2 commits May 26, 2026 17:44
When a worktree workspace has a pull request, the row's leading icon
turns into the PR-state-colored icon (open=green, merged=purple,
closed=red, draft=gray) and becomes a clickable button that opens the
PR URL on GitHub. Hovering the icon surfaces a tooltip with the PR
number ("Open PR #39 — click to open"), so the previous trailing
indicator — colored pill + duplicate PR number — is removed entirely.
Primary/remote/openflow workspaces keep their existing icons; non-PR
worktrees still fall back to the plain branch icon.

The agent-state status dots (working amber/pulsing, review green,
permission red/pulsing) are unchanged — StatusIndicator is positioned
absolutely as a sibling of the icon in the row's icon column, so the
dots still overlay the top-right corner regardless of whether the
leading glyph is the branch icon or the new PR-state icon.

Also reconciles package-lock.json with the 0.6.1 version bump in
package.json from a56074d (npm install side effect).
# Conflicts:
#	src/components/layout/sidebar-workspace-row.tsx
@Zeus-Deus Zeus-Deus merged commit a1a1c30 into main May 26, 2026
2 checks passed
@Zeus-Deus Zeus-Deus deleted the workspace-icon-pr-status branch May 26, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant